<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			//当前时间
			var date = new Date();
			console.log(date);

			var year = date.getFullYear();
			var month = date.getMonth() + 1; //从0开始
			var day = date.getDate();
			var hour = date.getHours();
			var min = date.getMinutes();
			var sec = date.getSeconds();
			console.log(year + "年" + month + "月" + day + "日");
			console.log(hour + "时" + min + "分" + sec + "秒");
			document.write(year + "年" + month + "月" + day + "日" + hour + "时" + min + "分" + sec + "秒")

			//1970 年 1 月 1 日 0 时 0 分 0 秒   毫秒数
			var t = date.getTime(); //1666061575987

			t = Date.now();
			console.log(t);
		</script>
	</head>
	<body>
	</body>
</html>
